package com.aishau.smartbj.activity;

import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.widget.LinearLayout;

import com.aishau.smartbj.R;
import com.aishau.smartbj.fregment.ContentFregment;
import com.aishau.smartbj.fregment.LeftMenuFregment;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
;

public class MainActivity extends Activity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        SlidingMenu menu = new SlidingMenu(this);
        menu.setMode(SlidingMenu.LEFT);
        menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
        menu.setShadowWidthRes(R.dimen.shadow_width);
//        activity_menu.setShadowDrawable(R.drawable.shadow);
        menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
        menu.setFadeDegree(0.35f);
        menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
        menu.setMenu(R.layout.activity_menu);

        initFregment();

    }

    private void initFregment() {

        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.replace(R.id.activity_main, new ContentFregment(), "MAIN_FREGMENT");
        ft.replace(R.id.activity_leftfregmet, new LeftMenuFregment(), "LEGT_FREGMENT");
        ft.commit();

    }
}
